package jsj.mynet;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketException;

public class MySendDemo {

	public static void main(String[] args) throws Exception {
		DatagramSocket ds = new DatagramSocket();
		//DatagramPacket dp = new DatagramPacket(arg0, arg1, arg2, arg3)
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		while((line = br.readLine()) != null){
			if(line.equals("886")){
				break;
			}
			byte[] bys = line.getBytes();
			DatagramPacket dp = new DatagramPacket(bys, bys.length, InetAddress.getLocalHost(), 10086);
			ds.send(dp);
		}
		ds.close();

	}

}
